package com.yuyou.train.user.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.train.service.api.user.entity.UserHwBe;
import com.yuyou.train.user.mapper.UserHwBeMapper;
import com.yuyou.train.user.service.IUserHwBeService;
import com.yuyou.train.util.bean.ResBoolSimpleInfo;
import com.yuyou.train.util.tool.Sequence;
import com.yuyou.train.util.tool.UUIDUtil;

@Service
public class UserHwBeServiceImpl implements IUserHwBeService{

	@Autowired
	private UserHwBeMapper userHwBeMapper;
	
	@Override
	public int deleteByPrimaryKey(String id) {
		return userHwBeMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(UserHwBe record) {
		record.setId(Sequence.getSequence().getNextId());
		record.setCreateTime(new Date());
		return userHwBeMapper.insert(record);
	}

	@Override
	public UserHwBe selectByPrimaryKey(String id) {
		return userHwBeMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(UserHwBe record) {
		return userHwBeMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public ResBoolSimpleInfo<String> addHwBe(UserHwBe userHwBe) {
		this.insert(userHwBe);
		return ResBoolSimpleInfo.getSuccessInfo();
	}

	@Override
	public ResBoolSimpleInfo<String> delByTeacherId(String userHwTeacherId) {
		userHwBeMapper.delByTeacherId(userHwTeacherId);
		return ResBoolSimpleInfo.getSuccessInfo();
	}

	@Override
	public List<UserHwBe> findByUserHwTeacherId(String userHwTeacherId) {
		return userHwBeMapper.findByUserHwTeacherId(userHwTeacherId);
	}









	
	
	
	
	
	
	
	
	
	
	
	
	
	
}